package com.yufuchang;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by yufuchang on 2020/9/4.
 */
@RestController
public class RestTemplateController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/request1")
    public String sendRequest(){
        return restTemplate.getForObject("http://v.juhe.cn/weather/forecast3h",String.class);
    }
}
